package com.lcm.jnode.model;

import java.util.List;

import com.jfinal.plugin.activerecord.Model;
import com.lcm.jnode.config.Constants;

/**
 * 博文标签
 * @author L.cm
 * @date 2013-6-6 下午1:34:44
 */
public class Tags extends Model<Tags> {

    private static final long serialVersionUID = -2208881735662609833L;

    public static final Tags dao = new Tags();
    
    public static final String ID = "id";					// id
    public static final String TAG_NAME = "tag_name";		// 标签名
    public static final String TAG_URL = "tag_url";         // 标签url    *直接链接到官网？
    public static final String TAG_IMAGE = "tag_image";     // 标签img
    public static final String TAG_EXPLAIN = "tag_explain"; // 标签说明
	public static final String DEL_STATUS = "del_status";	// 是否删除 默认：0  删除：1 
	public static final String CREATE_TIME = "create_time"; // 添加时间
	public static final String UPDATE_TIME = "update_time"; // 更新时间
	
	// tags list
    public List<Tags> findTagList(int num) {
        String sql = "SELECT t.* from l_tags t WHERE t.del_status = 0 LIMIT ?";
        return dao.findByCache(Constants.CACHE_TIME_MINI, sql, num);
    }
}
